/** * @license * Copyright 2018 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { QueryList } from "@angular/core"; import { Aai20Server, AaiSecurityRequirement, AaiServerBindings } from "apicurio-data-models"; import { EntityEditor, EntityEditorEvent, IEntityEditorHandler } from "./entity-editor.component"; import { NgModel } from "@angular/forms"; export interface ServerVariableData { default: string; description: string; enum: string[]; } export interface AaiServerData { url: string; description: string; variables: any; name: string; protocol: string; protocolVersion: string; security: AaiSecurityRequirement[]; bindings: AaiServerBindings; } export interface AaiServerEditorEvent extends EntityEditorEvent { data: AaiServerData; } export interface IAaiServerEditorHandler extends IEntityEditorHandler { onSave(event: AaiServerEditorEvent): void; onCancel(event: AaiServerEditorEvent): void; } export declare class AaiServerEditorComponent extends EntityEditor { urlInput: QueryList; model: AaiServerData; url: string; _varSelected: string; serverExists: boolean; /** * Initializes the editor's data model from a provided entity (initialize the editor data model from an entity). * @param entity */ initializeModelFromEntity(entity: Aai20Server): void; /** * Initializes the editor's data model to an empty state. */ initializeModel(): void; /** * Returns true if the data model is valid. */ isValid(): boolean; /** * Creates an entity event specific to this entity editor. */ entityEvent(): AaiServerEditorEvent; /** * Called when the URL changes. The URL will be parsed to find any variable substitutions * present in the URL spec. The map of variables is then updated to reflect whatever is found. */ updateVariables(): void; /** * Returns true if there are any variables to be configured. * @return */ hasVariables(): boolean; /** * Returns the names of the variables. * @return */ variableNames(): string[]; securityRequirementSummary(): string; /** * @param event */ onServerUrlKeypress(event: KeyboardEvent): void; /** * Returns true if there are URL changes. */ canApply(): boolean; /** * Called when the user clicks the "apply" button. */ apply(): void; /** * Called when the user clicks the "reset" button. */ reset(): void; }